package com.itheima.sky.mapper;

import com.itheima.sky.pojo.Category;
import com.itheima.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @Description DishFlavorMapper
 * @Author p
 * @Date 2024-06-28
 */
@Mapper
public interface DishFlavorMapper {

    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> findByDishId(Long id);

    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long id);


    @Select("select * from category where id = #{id}")
    Category findById(Long categoryId);

    void saveBatch(List<DishFlavor> dishFlavorList);
}
